From d736dc51ba93099bc05a68721d9165ec2094a4e3 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Tue, 31 Dec 2013 06:57:15 +0000 Subject: [PATCH] Fix (well, paper over...) heap-use-after-free in psitrex. --- gpsbabel/psitrex.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpsbabel/psitrex.cc b/gpsbabel/psitrex.cc index f514428cf..f7beaa434 100644 --- a/gpsbabel/psitrex.cc +++ b/gpsbabel/psitrex.cc @@ -357,9 +357,11 @@ psit_waypoint_w(gbfile* psit_file, const waypoint* wpt) ident = global_opts.synthesize_shortnames ? mkshort(mkshort_handle, src) : - CSTRc(wpt->shortname); + xstrdup(CSTRc(wpt->shortname)); gbfprintf(psit_file, " %-6s, ", ident); + xfree(ident); + icon = gt_find_icon_number_from_desc(wpt->icon_descr, PCX); if (get_cache_icon(wpt) && wpt->icon_descr.compare("Geocache Found") != 0) { -- 2.30.2